#include "TagList.h"
#include "BasicType.h"

namespace LightPlayer{

	const char* getTagString( TagList tag ){
		static map<TagList,string> DicTagName;
		static char NotValid[] = "NotValid";

		if( DicTagName.size() <= 0 ){
			DicTagName[eEnd] = "eEnd";
			DicTagName[ePlaceObject] = "ePlaceObject";
			DicTagName[ePlaceObject2] = "ePlaceObject2";
			DicTagName[ePlaceObject3] = "ePlaceObject3";
			DicTagName[eRemoveObject] = "eRemoveObject";
			DicTagName[eRemoveObject2] = "eRemoveObject2";
			DicTagName[eShowFrame] = "eShowFrame";
			DicTagName[eSetBackgroundColor] = "eSetBackgroundColor";
			DicTagName[eFrameLabel] = "eFrameLabel";
			DicTagName[eProtect] = "eProtect";
			DicTagName[eExportAssets] = "eExportAssets";
			DicTagName[eImportAssets] = "eImportAssets";
			DicTagName[eEnableDebugger] = "eEnableDebugger";
			DicTagName[eEnableDebugger2] = "eEnableDebugger2";
			DicTagName[eScriptLimits] = "eScriptLimits";
			DicTagName[eSetTabIndex] = "eSetTabIndex";
			DicTagName[eFileAttributes] = "eFileAttributes";
			DicTagName[eImpotAssets2] = "eImpotAssets2";
			DicTagName[eSymbolClass] = "eSymbolClass";
			DicTagName[eMetadata] = "eMetadata";
			DicTagName[eDefineScalingGrid] = "eDefineScalingGrid";
			DicTagName[eDefineSceneAndFrameLabelData] = "eDefineSceneAndFrameLabelData";
			DicTagName[eDoAction] = "eDoAction";
			DicTagName[eDoInitAction] = "eDoInitAction";
			DicTagName[eDoABC] = "eDoABC";
			DicTagName[eDefineSprite] = "eDefineSprite";
			DicTagName[eDefineShape] = "eDefineShape";
			DicTagName[eDefineShape2] = "eDefineShape2";
			DicTagName[eDefineShape3] = "eDefineShape3";
			DicTagName[eDefineShape4] = "eDefineShape4";
			DicTagName[eDefineMorphShape] = "eDefineMorphShape";
			DicTagName[eDefineMorphShape2] = "eDefineMorphShape2";
			DicTagName[eDefineBits] = "eDefineBits";
			DicTagName[eJPEGTables] = "eJPEGTables";
			DicTagName[eDefineBitsJPEG2] = "eDefineBitsJPEG2";
			DicTagName[eDefineBitsJPEG3] = "eDefineBitsJPEG3";
			DicTagName[eDefineBitsLossLess] = "eDefineBitsLossLess";
			DicTagName[eDefineBitsLossLess2] = "eDefineBitsLossLess2";
			DicTagName[eDefineBitsJPEG4] = "eDefineBitsJPEG4";
			DicTagName[eDefineFont] = "eDefineFont";
			DicTagName[eDefineFontInfo] = "eDefineFontInfo";
			DicTagName[eDefineFontInfo2] = "eDefineFontInfo2";
			DicTagName[eDefineFont2] = "eDefineFont2";
			DicTagName[eDefineFont3] = "eDefineFont3";
			DicTagName[eDefineFontAlignZones] = "eDefineFontAlignZones";
			DicTagName[eDefineFontName] = "eDefineFontName";
			DicTagName[eDefineText] = "eDefineText";
			DicTagName[eDefineText2] = "eDefineText2";
			DicTagName[eDefineEditText] = "eDefineEditText";
			DicTagName[eCSMTextSettings] = "eCSMTextSettings";
			DicTagName[eDefineFont4] = "eDefineFont4";
			DicTagName[eDefineSound] = "eDefineSound";
			DicTagName[eStartSound] = "eStartSound";
			DicTagName[eStartSound2] = "eStartSound2";
			DicTagName[eSoundStreamHead] = "eSoundStreamHead";
			DicTagName[eSoundStreamHead2] = "eSoundStreamHead2";
			DicTagName[eSoundStreamBlock] = "eSoundStreamBlock";
			DicTagName[eDefineButton] = "eDefineButton";
			DicTagName[eDefineButton2] = "eDefineButton2";
			DicTagName[eDefineButtonCxform] = "eDefineButtonCxform";
			DicTagName[eDefineButtonSound] = "eDefineButtonSound";
			DicTagName[eDefineVideoStream] = "eDefineVideoStream";
			DicTagName[eVideoFrame] = "eVideoFrame";
			DicTagName[eEnableTelemetry] = "eEnableTelemetry";
			DicTagName[eDefineBinaryData] = "eDefineBinaryData";
		}

		map<TagList,string>::iterator it = DicTagName.find(tag);
		if( it != DicTagName.end() ){
			return (it->second).c_str();
		}
		return NotValid;
	}


	const char* getActionString( ActionCode actionCode ){
		static map<ActionCode,string> DicActiongName;
		static char NotValid[] = "NotValid";

		if( DicActiongName.size() <= 0 ){
			DicActiongName[eActionGotoFrame			]="	eActionGotoFrame";			
			DicActiongName[eActionGetURL			]="eActionGetURL";	
			DicActiongName[eActionNextFrame			]="eActionNextFrame";			
			DicActiongName[eActionPreviousFrame		]="eActionPreviousFrame";		
			DicActiongName[eActionPlay				]="eActionPlay";					
			DicActiongName[eActionStop				]="eActionStop";					
			DicActiongName[eActionToggleQuality		]="eActionToggleQuality";		
			DicActiongName[eActionStopSounds		]="eActionStopSounds";			
			DicActiongName[eActionWaitForFrame		]="eActionWaitForFrame";			
			DicActiongName[eActionSetTarget			]="eActionSetTarget";			
			DicActiongName[eActionGoToLabel			]="eActionGoToLabel";			
			DicActiongName[eActionPush				]="eActionPush";					
			DicActiongName[eActionPop				]="eActionPop";					
			DicActiongName[eActionAdd				]="eActionAdd";					
			DicActiongName[eActionSubtract			]="eActionSubtract";				
			DicActiongName[eActionMultiply			]="eActionMultiply";				
			DicActiongName[eActionDivide			]="eActionDivide";				
			DicActiongName[eActionEquals			]="eActionEquals";				
			DicActiongName[eActionLess				]="eActionLess";					
			DicActiongName[eActionAnd				]="eActionAnd";					
			DicActiongName[eActionOr				]="eActionOr";					
			DicActiongName[eActionNot				]="eActionNot";					
			DicActiongName[eActionStringEquals		]="eActionStringEquals";			
			DicActiongName[eActionStringLength		]="eActionStringLength";			
			DicActiongName[eActionStringAdd			]="eActionStringAdd";			
			DicActiongName[eActionStringExtract		]="eActionStringExtract";		
			DicActiongName[eActionStringLess		]="eActionStringLess";			
			DicActiongName[eActionMBStringLength	]="eActionMBStringLength";		
			DicActiongName[eActionMBStringExtract	]="eActionMBStringExtract";		
			DicActiongName[eActionToInteger			]="eActionToInteger";			
			DicActiongName[eActionCharToAscii		]="eActionCharToAscii";			
			DicActiongName[eActionAsciiToChar		]="eActionAsciiToChar";			
			DicActiongName[eActionMBCharToAscii		]="eActionMBCharToAscii";		
			DicActiongName[eActionMBAsciiToChar		]="eActionMBAsciiToChar";		
			DicActiongName[eActionJump				]="eActionJump";					
			DicActiongName[eActionIf				]="eActionIf";					
			DicActiongName[eActionCall				]="eActionCall";					
			DicActiongName[eActionGetVariable		]="eActionGetVariable";			
			DicActiongName[eActionSetVariable		]="eActionSetVariable";			
			DicActiongName[eActionGetURL2			]="eActionGetURL2";				
			DicActiongName[eActionGoToFrame2		]="eActionGoToFrame2";			
			DicActiongName[eActionSetTarget2		]="eActionSetTarget2";			
			DicActiongName[eActionGetProperty		]="eActionGetProperty";			
			DicActiongName[eActionSetProperty		]="eActionSetProperty";			
			DicActiongName[eActionCloneSprite		]="eActionCloneSprite";			
			DicActiongName[eActionRemoveSprite		]="eActionRemoveSprite";			
			DicActiongName[eActionStartDrag			]="eActionStartDrag";			
			DicActiongName[eActionEndDrag			]="eActionEndDrag";				
			DicActiongName[eActionWaitForFrame2		]="eActionWaitForFrame2";		
			DicActiongName[eActionTrace				]="eActionTrace";				
			DicActiongName[eActionGetTime			]="eActionGetTime";				
			DicActiongName[eActionRandomNumber		]="eActionRandomNumber";			
			DicActiongName[eActionCallFunction		]="eActionCallFunction";			
			DicActiongName[eActionCallMethod		]="eActionCallMethod";			
			DicActiongName[eActionConstantPool		]="eActionConstantPool";			
			DicActiongName[eActionDefineFunction	]="eActionDefineFunction";		
			DicActiongName[eActionDefineLocal		]="eActionDefineLocal";			
			DicActiongName[eActionDefineLocal2		]="eActionDefineLocal2";			
			DicActiongName[eActionDelete			]="eActionDelete";				
			DicActiongName[eActionDelete2			]="eActionDelete2";				
			DicActiongName[eActionEnumarate			]="eActionEnumarate";			
			DicActiongName[eActionEquals2			]="eActionEquals2";				
			DicActiongName[eActionGetMember			]="eActionGetMember";			
			DicActiongName[eActionInitArray			]="eActionInitArray";			
			DicActiongName[eActionInitObject		]="eActionInitObject";			
			DicActiongName[eActionNewMethod			]="eActionNewMethod";			
			DicActiongName[eActionNewObject			]="eActionNewObject";			
			DicActiongName[eActionSetMember			]="eActionSetMember";			
			DicActiongName[eActionTargetPath		]="eActionTargetPath";			
			DicActiongName[eActionWith				]="eActionWith";					
			DicActiongName[eActionToNumber			]="eActionToNumber";				
			DicActiongName[eActionToString			]="eActionToString";				
			DicActiongName[eActionTypeOf			]="eActionTypeOf";				
			DicActiongName[eActionAdd2				]="eActionAdd2";					
			DicActiongName[eActionLess2				]="eActionLess2";				
			DicActiongName[eActionModulo			]="eActionModulo";				
			DicActiongName[eActionBitAnd			]="eActionBitAnd";				
			DicActiongName[eActionBitLShift			]="eActionBitLShift";			
			DicActiongName[eActionBitOr				]="eActionBitOr";				
			DicActiongName[eActionBitRShift			]="eActionBitRShift";			
			DicActiongName[eActionBitURShift		]="eActionBitURShift";			
			DicActiongName[eActionBitXor			]="eActionBitXor";				
			DicActiongName[eActionDecrement			]="eActionDecrement";			
			DicActiongName[eActionIncrement			]="eActionIncrement";			
			DicActiongName[eActionPushDuplicate		]="eActionPushDuplicate";		
			DicActiongName[eActionReturn			]="eActionReturn";				
			DicActiongName[eActionStackSwap			]="eActionStackSwap";			
			DicActiongName[eActionStoreRegister		]="eActionStoreRegister";		
			DicActiongName[eActionInstanceOf		]="eActionInstanceOf";			
			DicActiongName[eActionEnumerate2		]="eActionEnumerate2";			
			DicActiongName[eActionStrictEquals		]="eActionStrictEquals";			
			DicActiongName[eActionGreater			]="eActionGreater";				
			DicActiongName[eActionStringGreater		]="eActionStringGreater";		
			DicActiongName[eActionDefineFunction2	]="eActionDefineFunction2";		
			DicActiongName[eActionExtends			]="eActionExtends";				
			DicActiongName[eActionCastOp			]="eActionCastOp";				
			DicActiongName[eActionImplementsOp		]="eActionImplementsOp";			
			DicActiongName[eActionTry				]="eActionTry";					
			DicActiongName[eActionThrow				]="eActionThrow";				
		}

		map<ActionCode,string>::iterator it = DicActiongName.find(actionCode);
		if( it != DicActiongName.end() ){
			return (it->second).c_str();
		}
		return NotValid;
	}

};